//*************************SaveAsImage */
import 'package:json_annotation/json_annotation.dart';

import 'item_style.dart';
import 'tooltip.dart';

part 'toolbox.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class ToolboxEmphasis {
  ItemStyle? iconStyle;

  ToolboxEmphasis({this.iconStyle});

  factory ToolboxEmphasis.fromJson(Map<String, dynamic> json) => _$ToolboxEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$ToolboxEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class SaveAsImage {
  var type;
  var name;
  var backgroundColor;
  var connectedBackgroundColor;
  var excludeComponents;
  var show;
  var title;
  var icon;
  ItemStyle? iconStyle;
  ToolboxEmphasis? emphasis;
  var pixelRatio;

  SaveAsImage(
      {this.type,
      this.name,
      this.backgroundColor,
      this.connectedBackgroundColor,
      this.excludeComponents,
      this.show,
      this.title,
      this.icon,
      this.iconStyle,
      this.emphasis,
      this.pixelRatio});

  factory SaveAsImage.fromJson(Map<String, dynamic> json) => _$SaveAsImageFromJson(json);

  Map<String, dynamic> toJson() => _$SaveAsImageToJson(this);
}

//*******************************end SaveAsImage */

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class Restore {
  var show;
  var title;
  var icon;
  ItemStyle? iconStyle;
  ToolboxEmphasis? emphasis;

  Restore({this.show, this.title, this.icon, this.iconStyle, this.emphasis});

  factory Restore.fromJson(Map<String, dynamic> json) => _$RestoreFromJson(json);

  Map<String, dynamic> toJson() => _$RestoreToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class DataView {
  var show;
  var title;
  var icon;
  ItemStyle? iconStyle;
  ToolboxEmphasis? emphasis;
  var readOnly;
  var optionToContent;
  var contentToOption;
  var lang;
  var backgroundColor;
  var textareaColor;
  var textareaBorderColor;
  var textColor;
  var buttonColor;
  var buttonTextColor;

  DataView(
      {this.show,
      this.title,
      this.icon,
      this.iconStyle,
      this.emphasis,
      this.readOnly,
      this.optionToContent,
      this.contentToOption,
      this.lang,
      this.backgroundColor,
      this.textareaColor,
      this.textareaBorderColor,
      this.textColor,
      this.buttonColor,
      this.buttonTextColor});

  factory DataView.fromJson(Map<String, dynamic> json) => _$DataViewFromJson(json);

  Map<String, dynamic> toJson() => _$DataViewToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class DataZoomItem {
  var zoom;
  var back;

  DataZoomItem({this.zoom, this.back});

  factory DataZoomItem.fromJson(Map<String, dynamic> json) => _$DataZoomItemFromJson(json);

  Map<String, dynamic> toJson() => _$DataZoomItemToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class ToolboxDataZoom {
  var show;
  DataZoomItem? title;
  DataZoomItem? icon;
  ItemStyle? iconStyle;
  ToolboxEmphasis? emphasis;
  var filterMode;
  var xAxisIndex;
  var yAxisIndex;
  ItemStyle? brushStyle;

  ToolboxDataZoom(
      {this.show,
      this.title,
      this.icon,
      this.iconStyle,
      this.emphasis,
      this.filterMode,
      this.xAxisIndex,
      this.yAxisIndex,
      this.brushStyle});

  factory ToolboxDataZoom.fromJson(Map<String, dynamic> json) => _$ToolboxDataZoomFromJson(json);

  Map<String, dynamic> toJson() => _$ToolboxDataZoomToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class MagicTypeItem {
  var line;
  var bar;
  var stack;
  var tiled;

  MagicTypeItem({this.line, this.bar, this.stack, this.tiled});

  factory MagicTypeItem.fromJson(Map<String, dynamic> json) => _$MagicTypeItemFromJson(json);

  Map<String, dynamic> toJson() => _$MagicTypeItemToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class MagicType {
  var show;
  var type;
  MagicTypeItem? title;
  MagicTypeItem? icon;
  ItemStyle? iconStyle;
  ToolboxEmphasis? emphasisInFeature;
  MagicTypeItem? option;
  MagicTypeItem? seriesIndex;

  MagicType(
      {this.show,
      this.type,
      this.title,
      this.icon,
      this.iconStyle,
      this.emphasisInFeature,
      this.option,
      this.seriesIndex});

  factory MagicType.fromJson(Map<String, dynamic> json) => _$MagicTypeFromJson(json);

  Map<String, dynamic> toJson() => _$MagicTypeToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class BrushItem {
  var rect;
  var polygon;
  var lineX;
  var lineY;
  var keep;
  var clear;

  BrushItem(
      {this.rect, this.polygon, this.lineX, this.lineY, this.keep, this.clear});


  factory BrushItem.fromJson(Map<String, dynamic> json) => _$BrushItemFromJson(json);

  Map<String, dynamic> toJson() => _$BrushItemToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class ToolboxBrush {
  var type;
  BrushItem? icon;
  BrushItem? title;

  ToolboxBrush({this.type, this.icon, this.title});

  factory ToolboxBrush.fromJson(Map<String, dynamic> json) => _$ToolboxBrushFromJson(json);

  Map<String, dynamic> toJson() => _$ToolboxBrushToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class Feature {
  SaveAsImage? saveAsImage;
  Restore? restore;
  DataView? dataView;
  ToolboxDataZoom? dataZoom;
  MagicType? magicType;
  ToolboxBrush? brush;

  Feature(
      {this.saveAsImage,
      this.restore,
      this.dataView,
      this.dataZoom,
      this.magicType,
      this.brush});

  factory Feature.fromJson(Map<String, dynamic> json) => _$FeatureFromJson(json);

  Map<String, dynamic> toJson() => _$FeatureToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class Toolbox {
  var id;
  var show;
  var orient;
  var itemSIze;
  var itemGap;
  var showTitle;
  Feature? feature;
  ItemStyle? iconStyle;
  ToolboxEmphasis? emphasis;
  var zlvel;
  var z;

  var left;
  var top;
  var right;
  var bottom;

  var width;
  var height;

  Tooltip? tooltip;

  Toolbox(
      {this.id,
      this.show,
      this.orient,
      this.itemSIze,
      this.itemGap,
      this.showTitle,
      this.feature,
      this.iconStyle,
      this.emphasis,
      this.zlvel,
      this.z,
      this.left,
      this.top,
      this.right,
      this.bottom,
      this.width,
      this.height,
      this.tooltip});

  factory Toolbox.fromJson(Map<String, dynamic> json) => _$ToolboxFromJson(json);

  Map<String, dynamic> toJson() => _$ToolboxToJson(this);
}
